﻿using Pap.Data;
using Pap.Web.Utils;

namespace Pap.Web.Modules.Administration.ViewModel
{
    /// <summary>
    /// 
    /// </summary>
    public class DatabaseManagementUIViewModel : IViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        private IAdministrationRepository _AdminRepo;

        /// <summary>
        /// Initializes a new instance of the <see cref="DatabaseManagementUIViewModel"/> class.
        /// </summary>
        /// <param name="repo">The repo.</param>
        public DatabaseManagementUIViewModel(IAdministrationRepository repo)
        {
            _AdminRepo = repo;
        }

        /// <summary>
        /// Backs up database.
        /// </summary>
        internal void BackUpDatabase(string path)
        {
            _AdminRepo.BackupDatabase(path);
        }

        /// <summary>
        /// Restores the database.
        /// </summary>
        internal void RestoreDatabase(string path)
        {
            _AdminRepo.RestoreDatabas(path);
        }
    }
}
